<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>
    
    <title></title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<link rel="stylesheet" type="text/css" href="<%=basePath%>ext-3.2.1/resources/css/ext-all.css"/>
	<script type="text/javascript" src="<%=basePath%>ext-3.2.1/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="<%=basePath%>ext-3.2.1/ext-all.js"></script>
	<script type="text/javascript" src="<%=basePath%>ext-3.2.1/ux/PageComboResizer.js"></script>
	<script type="text/javascript" src="<%=basePath%>ext-3.2.1/ext-lang-zh_CN.js"></script>
		
	<script type="text/javascript" src="<%=basePath%>scripts/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>scripts/apputil.js"></script>
	<script type="text/javascript" src="<%=basePath%>pages/organization/group.js"></script>
	<link rel="stylesheet" href="../scripts/kindeditor-4.1/plugins/code/prettify.css" />
	<script charset="utf-8" src="../scripts/kindeditor-4.1/kindeditor-min.js"></script>
	<script charset="utf-8" src="../scripts/kindeditor-4.1/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../scripts/kindeditor-4.1/plugins/code/prettify.js"></script>
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
	  <style type="text/css">
	    body{
	    font-size: 12px;
	  }
	  	.td{
			height: 25px;
		}
		.tdB {
			border-bottom:1px solid #0190FB;
		}
		
		.tdL {
			border-left:1px solid #0190FB;
		}
		
		.tdR {
			border-right:1px solid #0190FB;
		}
		
		.tdT {
			border-top:1px solid #0190FB;
		}
	</style>
	<script type="text/javascript">
		function checkForm(){
	    var name = $("#name");
	    if (name.val()=="") {
	        alert("组名称不能为空！")
	        name.focus();
	        return false;
	    }
	    /*else{
	    	if(!checkName(name.val())){
				alert("组名称只能为汉字");
				name.focus();
				return false;
			}
	    }*/
	    if(trim($("#content2").val()).length>100)
	    {
	      alert("简介最多100字符！");
	       return false;
	    }
	    if(document.getElementById("video")){	
	    var url = $("#video").val();
	    var extend ;
		if(url!=""){
		  	extend = url.substring(url.lastIndexOf(".")+1);
			if(!(extend=="flv")){
			   alert("请上传后缀名为flv的视频文件!");
			   return false;
			}
        }
        }
	    document.forms[0].submit();
	    
	}
	function  modifyvideo(id){
       $("#modifyvideo").html('<input type="file" name="videoFile" id="video"/>&nbsp;&nbsp;&nbsp;<input type="button" value="取消" onclick="movevideo()"/>');
       $('#'+id).hide();
   }
   
   function  movevideo(){
      var videobtn=document.getElementById("videobtn");
      $("#modifyvideo").html('');
      videobtn.style.display='inline';
   }
	</script>
	<body>
	<form action="<%=basePath%>group/save.action" method="post" id="myform" name="myform" enctype="multipart/form-data"> 
	<div align="center">
	<table width="80%" border="0" cellspacing="1" cellpadding="5" class="tabCls" style="margin-top: 10px;">
		<tr>
			<td colspan="4" align="center" bgcolor="#ffffff">
				<span style="font-size: 25px; font: ; font-weight: bold;">组信息维护&nbsp;<font color='red' size="2px;">(*为必填项)</font></span>
			</td>
		</tr>
	</table>
		<table width="85%" border="0" style="margin-top: 10px;" cellpadding="0" cellspacing="0">
			
			<tr>
				<td align="right" class="tdT tdR tdL" width="20%">组名称：</td>
				<td colspan="4" class="tdT tdR" width="100%" align="left"><input id="name" maxlength="30" size="50" type="text" value="<s:property value="group.name"/>" name="group.name">&nbsp;<font color='red'>*</font></td>
			</tr>
			
			<tr>
				<td align="right" class="tdR tdL tdB tdT">简介：</td>
				<td class="tdR tdB tdT" colspan="4">
				<textarea style="width:770px;height:100px;word-wrap:break-word;" name="group.summary" id="content2"><s:property value="group.summary" /></textarea>
				</td>
			</tr>
				<tr>
				<td align="right" class="tdR tdL tdT  " >视频：</td>
				<c:if test="${group.videosrc != null}">
				<td align="left"  colspan="4" class=" tdR ">
					<a href="../pages/flvplay.jsp?url=<%=basePath%>${group.videosrc}" target="_blank"/>浏览视频</a>&nbsp;&nbsp;&nbsp;<s:if test="flag==1"><span id="videobtn"><input type="button"  onclick="modifyvideo('videobtn')" value="修改"/></span></s:if>
				     <div id="modifyvideo"></div>
				</td>
				</c:if>
				<c:if test="${group.videosrc == null}">
				<td align="left"  colspan="4" class="tdR tdL tdB ">
					<input type="file" name="videoFile" id="video" size="69"/> 
				</td>
				</c:if>
			</tr>
			<tr>
				<td align="right" class="tdR tdL tdB ">描述：</td>
				<td class="tdR tdB tdT" colspan="4">
				<textarea style="width:770px;height:300px;word-wrap:break-word;" name="group.description" id="content1"><s:property value="group.description" /></textarea>
				</td>
			</tr>
		</table>
		
		
		<input type="hidden" id="hid" name="group.hid" value="<s:property value="group.hid"/>"/>
		<input type="hidden" id="did" name="group.did" value="<s:property value="group.did"/>"/>
		<input type="hidden" id="id" name="group.id" value="<s:property value="group.id"/>"/>
		<input type="hidden" name="group.videosrc" value="<s:property value="group.videosrc"/>"/>
		<input type="hidden" id="deleteFlag" name="group.deleteFlag" value="<s:property value="group.deleteFlag"/>"/>
		
		<table width="80%" class="tabCls">
		<tr>
			<td align="center">
			<s:if test="flag==1">
				<input type="button" id="save" name="Submit" value="保 存" 
					onClick="checkForm()" class="button_sty saveBtn" />
			</s:if>
				<input type="button" id="reset" name="reset" value="返 回"
						onClick="goBackReset()" class="button_sty backBtn" />
			</td>
		</tr>
	</table>
	</div>
	</form>
	</body>
	<script type="text/javascript">
		var editor;
        KindEditor.ready(function(K) {
		               editor = K.create('#content1', {
		               allowFileManager : true,
		               uploadJson : '../scripts/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../scripts/kindeditor-4.1/file_manager_json.jsp',
				         afterBlur:function(){ 
				            this.sync(); 
				        },       
                       items : [
					 	           'preview','source', '|', 'undo', 'redo', '|',  'cut', 'copy', 'paste',
						        'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						       'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',
						        'link', 'unlink'
                  ]
                        
                });
        });
  
		
		
	</script>
	
	
	
</html>
